<style lang="scss" scoped>
.infosend-module {
  margin-top: 1.25rem;
  .table-show table {
    .ctc textarea {
      width: 100%;
      margin: 0.25rem 0;
    }
    tr.apply-ctc {
      border: none;
    }
    textarea {
      height: 2.75rem;
      resize: none;
      text-indent: 0.1rem;
      outline: none;
      border: none;
      color: #333;
      -webkit-user-select: auto;
    }
    textarea::-webkit-input-placeholder {
      color: #999;
    }
  }
}
.operation {
  border: none;
  position: fixed;
  padding: 0;
  margin: 0;
  width: 100%;
  bottom: 0.25rem;
  .button {
    margin: 0 0.4rem;
  }
}
</style>
<template>
  <div>
    <headTop :theRouter="therouter"></headTop>
    <div class="infosend-module">
      <div class="table-show">
        <table>
          <tbody>
            <tr>
              <td class="column">申请结果</td>
              <td class="ctc">
                <group>
                  <selector placeholder="请选择审核意见" v-model="auditResult" direction="rtl" :options="auditResultList"></selector>
                </group>
              </td>
            </tr>
            <tr class="apply-ctc">
              <td class="column" colspan="2">审核意见</td>
            </tr>
            <tr>
              <td class="ctc" colspan="2">
                <textarea name="" id="" v-model="auditContent" placeholder="请填写审核意见" contenteditable="true"></textarea>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
    <div class="operation">
      <div class="button" @click="auditSure">确定</div>
    </div>
  </div>
</template>
<script>
import { BASEURL } from "./../../api/api"
import axios from "axios"
import headTop from "./../common/header"
import { Group, Selector } from "vux"
export default {
  name: "cutoffwateraudit",
  components: {
    headTop,
    Group,
    Selector
  },
  computed: {
    therouter: function() {
      return this.$route;
    }
  },
  data() {
    return {
      auditResult: null,
      auditContent: null,
      auditResultList: [
        { key: 1, value: "通过" },
        { key: 2, value: "不通过" }
      ]
    };
  },
  methods: {
    auditSure(){
      let _self = this;
      if(_self.auditResult==null||_self.auditResult==''){
          _self.$Message.warning('请选择审核意见！');
          return false;
      }
      if(_self.auditContent==null||_self.auditContent==''){
          _self.$Message.warning('请填写审核内容！');
          return false;
      }
      alert(_self.auditResult)
      
      axios.get(BASEURL + "saveAuditApply", {
          params: {
            auditor_id: window.localStorage.getItem('USER_ID'),
            auditor_name: window.localStorage.getItem('USER_NAME'),
            audit_content: _self.auditContent,
            status: _self.auditResult,
            applyId: _self.$route.query.applyId
          }
        }).then(res => {
            _self.$Message.success('审核完成！');
            _self.$router.push({path: '/infoaudit'})
        }).catch(error => {
          console.log(error);
        });
    }
  }
};
</script>


